
#ifndef UNDERTOPOMGR_H_

#define UNDERTOPOMGR_H_

#include "object.h"
#include "common.h"

class Node;
class Packet;

class UnderTopoMgr : public Object{
	public:
		~UnderTopoMgr();

		static UnderTopoMgr& instance() { return *instance_; }
		static bool create();
		static void destroy();

		bool init();
		bool send( node_id_t src_id, node_id_t dst_id, Packet *packet );

		sim_time_t latency( node_id_t src_id, node_id_t dst_id );
		Node*      node( node_id_t id );
		uint32_t   networkSize() const { return (uint32_t)nodes_.size(); }

	protected:
		UnderTopoMgr(){}
		bool createTopoStatic();
		bool createTopoFromFile();

	protected:
		static UnderTopoMgr *instance_;

		TNodeVector nodes_;
		TNodeVector online_nodes_;
};

#endif /* UNDERTOPOMGR_H_ */

